package com.czhoujunlv.weather;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class City_SQLite extends SQLiteOpenHelper {
    public City_SQLite(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table citys(id integer primary key autoincrement,city_name varchar(50),low_temp integer,high_temp interger,now_temp integer)";
        db.execSQL(sql);// 这一步就完成了加载驱动和建立连接

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
